package com.mianyang.zhangsan.plugin.quartz;


import com.mianyang.zhangsan.model.entity.SecTask;
import com.mianyang.zhangsan.plugin.quartz.util.QuartzExecuteHelper;
import org.quartz.JobExecutionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;

/**
 * @author jiangjr
 * @date 2022-11-19
 */
@Component
public class SecQuartzJob extends AbstractJob {
    @Autowired
    private QuartzExecuteHelper quartzExecuteHelper;

    @Override
    public void doExecute(JobExecutionContext context, SecTask task) {
        Assert.notNull(task, "执行任务不能为空");
        quartzExecuteHelper.invoke(task);
    }
}
